package com.huanglaoshi.java.io;

import java.io.File;

import org.junit.Test;

public class File04OperateDemo {
	
	@Test
	public void createNewFile() throws Exception {
		File f01 = new File("io_new/aa.txt");
		boolean flag = f01.createNewFile();
		if(flag){
			System.out.println("新建文件成功...");
		}else{
			System.out.println("新建文件失败...");
		}
		
	}
	
	@Test
	public void delete() throws Exception {
		File f01 = new File("io/aa.txt");
		boolean flag = f01.delete();
		if(flag){
			System.out.println("删除文件成功...");
		}else{
			System.out.println("删除文件失败...");
		}
		
	}

}
